home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_weap_fists.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  135 lines

  1. # Jones 3D Cog Script
  2. #
  3. # weap_Fists.cog
  4. #
  5. # [RandyT]
  6. #
  7. # Punch with the left fist, then the right fist.
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15. message        startup
  16. message        fire
  17. message        activated
  18. message        deactivated
  19. message        selected
  20. message        deselected
  21.  
  22. template    projectile=+fists    local            
  23.  
  24. thing        player                local
  25.  
  26. flex        fireWait            local
  27.  
  28. int            nextFist=0            local
  29. int            pupMode                local
  30.  
  31. vector        firePoint            local
  32.  
  33. end
  34.  
  35. # ===================================================================
  36.  
  37. code
  38.  
  39. startup:
  40.  
  41.     player = GetLocalPlayerThing();
  42.     return;
  43.  
  44. # -------------------------------------------------------------------
  45.  
  46. fire:
  47.  
  48.     # If the message is from the weapons system, play the animation
  49.     if (GetParam(0) != -1)
  50.     {
  51.         # Select-o-punch
  52.         if (nextFist == 0)
  53.         {
  54.             if (Rand() < 0.5)
  55.             {
  56.                 pupMode = 65;
  57.                 fireWait = 0.57; 
  58.             
  59.             } else {
  60.                 
  61.                 pupMode = 66;
  62.                 fireWait = 0.6; 
  63.             }
  64.  
  65.         } else {
  66.  
  67.             if (Rand() < 0.5)
  68.             {
  69.                 pupMode = 67;
  70.  
  71.             } else {
  72.                 
  73.                 pupMode = 68;
  74.             }
  75.             fireWait = 0.7; 
  76.         }
  77.  
  78.         nextFist = 1 - nextFist;
  79.  
  80.         SetFireWait(player, fireWait);
  81.  
  82.         CaptureThing(player);
  83.         PlayMode(player, pupMode, 0);
  84.  
  85.         return;
  86.     }
  87.  
  88.     # Actual firing takes place when we get the callback...
  89.     firePoint = VectorAdd(GetThingPos(player), '0.0 0.0 0.05');
  90.     FireProjectile(player, projectile, -1, -1, firePoint, '0 0 0', 1.0, 0x0, 0.0, 0.0);
  91.  
  92.     return;
  93.  
  94. # -------------------------------------------------------------------
  95.  
  96. activated:
  97.  
  98.     ActivateWeapon(player, 0.01);
  99.     return;
  100.  
  101. # -------------------------------------------------------------------
  102.  
  103. deactivated:
  104.  
  105.     DeactivateWeapon(player);
  106.     return;
  107.  
  108. # -------------------------------------------------------------------
  109.  
  110. selected:
  111.  
  112.     SetAimWait(player, 0);
  113.     SetMountWait(player, 0.5);
  114.  
  115.     SetArmedMode(player, 0);
  116.     SetCurWeapon(player, 1);
  117.     SetThingFireOffset(player, '0.0 0.0 0.0');
  118.  
  119.     PlayMode(player, 62, 0);
  120.  
  121.     return;
  122.  
  123. # -------------------------------------------------------------------
  124.  
  125. deselected:
  126.  
  127.     SetMountWait(player, 0.5);
  128.  
  129.     StopMode(player, 62, 0);
  130.     PlayMode(player, 64, 0);
  131.  
  132.     return;
  133.  
  134. end
  135.